﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace md.imi.membrane.common.Interfaces
{
    /// <summary>
    /// Interface must be implemented by all the objects which are cacheable
    /// </summary>
    public interface ICacheableObject
    {
        /// <summary>
        ///     The method must be capable to dump (save) the own object into a XML file,
        /// whose name is automatically calculaded as a {GUID}.XML.  
        /// </summary>
        /// <returns></returns>
        bool PersistObjectToCach();

        /// <summary>
        ///     On request, function composes the file name 
        /// {GUID}.XML. If the file is found, the persisted objects are loaded back to
        /// memory, and the XML file is removed.
        /// 
        /// This function is usually called by the property getter
        /// </summary>
        /// <returns></returns>
        bool RestoreObjectFromCach();

    }
}
